package com.learn.micro_mall.service.convertor.category;

import com.learn.micro_mall.domain.entity.brand.BrandEntity;
import com.learn.micro_mall.domain.entity.category.CategoryEntity;
import com.learn.micro_mall.service.request.brand.BrandCreateRequest;
import com.learn.micro_mall.service.request.brand.BrandDeleteRequest;
import com.learn.micro_mall.service.request.brand.BrandUpdateRequest;
import com.learn.micro_mall.service.request.category.CategoryCreateRequest;
import com.learn.micro_mall.service.request.category.CategoryUpdateRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface CategoryMapper {

    /**
     * 获取该类自动生成的实现类的实例
     * 接口中的属性都是 public static final 的 方法都是public abstract的
     */
    CategoryMapper INSTANCES = Mappers.getMapper(CategoryMapper.class);

    CategoryEntity toCategoryEntity(CategoryCreateRequest request);


        @Mappings({
            @Mapping(source = "categoryId", target = "categoryId.categoryId")
    })
    CategoryEntity toCategoryEntity(CategoryUpdateRequest request);

//    CategoryEntity toCategoryEntity(BrandUpdateRequest request);
//
//    CategoryEntity toCategoryEntity(BrandDeleteRequest request);

}
